{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from pandas import Series, DataFrame"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# series reindex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s1 = Series([1,2,3,4], index=['A','B','C','D'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    1\n",
       "B    2\n",
       "C    3\n",
       "D    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    1.0\n",
       "B    2.0\n",
       "C    3.0\n",
       "D    4.0\n",
       "E    NaN\n",
       "dtype: float64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1.reindex(index=['A','B','C','D','E'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A     1\n",
       "B     2\n",
       "C     3\n",
       "D     4\n",
       "E    10\n",
       "dtype: int64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1.reindex(index=['A','B','C','D','E'], fill_value=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "s2 = Series(['A','B','C'], index=[1,5,10])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1     A\n",
       "5     B\n",
       "10    C\n",
       "dtype: object"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     NaN\n",
       "1       A\n",
       "2       A\n",
       "3       A\n",
       "4       A\n",
       "5       B\n",
       "6       B\n",
       "7       B\n",
       "8       B\n",
       "9       B\n",
       "10      C\n",
       "11      C\n",
       "12      C\n",
       "13      C\n",
       "14      C\n",
       "dtype: object"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2.reindex(index=range(15),method='ffill')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# reindex dataframe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1 = DataFrame(np.random.rand(25).reshape([5,5]), index=['A','B','D','E','F'], columns=['c1','c2','c3','c4','c5'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>c1</th>\n",
       "      <th>c2</th>\n",
       "      <th>c3</th>\n",
       "      <th>c4</th>\n",
       "      <th>c5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>0.649883</td>\n",
       "      <td>0.611234</td>\n",
       "      <td>0.147865</td>\n",
       "      <td>0.307980</td>\n",
       "      <td>0.674897</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.615217</td>\n",
       "      <td>0.627108</td>\n",
       "      <td>0.458184</td>\n",
       "      <td>0.495353</td>\n",
       "      <td>0.072155</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>D</th>\n",
       "      <td>0.741560</td>\n",
       "      <td>0.117488</td>\n",
       "      <td>0.897019</td>\n",
       "      <td>0.296116</td>\n",
       "      <td>0.558359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>E</th>\n",
       "      <td>0.969148</td>\n",
       "      <td>0.218885</td>\n",
       "      <td>0.235853</td>\n",
       "      <td>0.164188</td>\n",
       "      <td>0.203482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>F</th>\n",
       "      <td>0.173675</td>\n",
       "      <td>0.337967</td>\n",
       "      <td>0.788934</td>\n",
       "      <td>0.511270</td>\n",
       "      <td>0.256199</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         c1        c2        c3        c4        c5\n",
       "A  0.649883  0.611234  0.147865  0.307980  0.674897\n",
       "B  0.615217  0.627108  0.458184  0.495353  0.072155\n",
       "D  0.741560  0.117488  0.897019  0.296116  0.558359\n",
       "E  0.969148  0.218885  0.235853  0.164188  0.203482\n",
       "F  0.173675  0.337967  0.788934  0.511270  0.256199"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>c1</th>\n",
       "      <th>c2</th>\n",
       "      <th>c3</th>\n",
       "      <th>c4</th>\n",
       "      <th>c5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>0.649883</td>\n",
       "      <td>0.611234</td>\n",
       "      <td>0.147865</td>\n",
       "      <td>0.307980</td>\n",
       "      <td>0.674897</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.615217</td>\n",
       "      <td>0.627108</td>\n",
       "      <td>0.458184</td>\n",
       "      <td>0.495353</td>\n",
       "      <td>0.072155</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>D</th>\n",
       "      <td>0.741560</td>\n",
       "      <td>0.117488</td>\n",
       "      <td>0.897019</td>\n",
       "      <td>0.296116</td>\n",
       "      <td>0.558359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>E</th>\n",
       "      <td>0.969148</td>\n",
       "      <td>0.218885</td>\n",
       "      <td>0.235853</td>\n",
       "      <td>0.164188</td>\n",
       "      <td>0.203482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>F</th>\n",
       "      <td>0.173675</td>\n",
       "      <td>0.337967</td>\n",
       "      <td>0.788934</td>\n",
       "      <td>0.511270</td>\n",
       "      <td>0.256199</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         c1        c2        c3        c4        c5\n",
       "A  0.649883  0.611234  0.147865  0.307980  0.674897\n",
       "B  0.615217  0.627108  0.458184  0.495353  0.072155\n",
       "C       NaN       NaN       NaN       NaN       NaN\n",
       "D  0.741560  0.117488  0.897019  0.296116  0.558359\n",
       "E  0.969148  0.218885  0.235853  0.164188  0.203482\n",
       "F  0.173675  0.337967  0.788934  0.511270  0.256199"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.reindex(index=['A','B','C','D','E','F'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>c1</th>\n",
       "      <th>c2</th>\n",
       "      <th>c3</th>\n",
       "      <th>c4</th>\n",
       "      <th>c5</th>\n",
       "      <th>c6</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>0.649883</td>\n",
       "      <td>0.611234</td>\n",
       "      <td>0.147865</td>\n",
       "      <td>0.307980</td>\n",
       "      <td>0.674897</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.615217</td>\n",
       "      <td>0.627108</td>\n",
       "      <td>0.458184</td>\n",
       "      <td>0.495353</td>\n",
       "      <td>0.072155</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>D</th>\n",
       "      <td>0.741560</td>\n",
       "      <td>0.117488</td>\n",
       "      <td>0.897019</td>\n",
       "      <td>0.296116</td>\n",
       "      <td>0.558359</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>E</th>\n",
       "      <td>0.969148</td>\n",
       "      <td>0.218885</td>\n",
       "      <td>0.235853</td>\n",
       "      <td>0.164188</td>\n",
       "      <td>0.203482</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>F</th>\n",
       "      <td>0.173675</td>\n",
       "      <td>0.337967</td>\n",
       "      <td>0.788934</td>\n",
       "      <td>0.511270</td>\n",
       "      <td>0.256199</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         c1        c2        c3        c4        c5  c6\n",
       "A  0.649883  0.611234  0.147865  0.307980  0.674897 NaN\n",
       "B  0.615217  0.627108  0.458184  0.495353  0.072155 NaN\n",
       "D  0.741560  0.117488  0.897019  0.296116  0.558359 NaN\n",
       "E  0.969148  0.218885  0.235853  0.164188  0.203482 NaN\n",
       "F  0.173675  0.337967  0.788934  0.511270  0.256199 NaN"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.reindex(columns=['c1','c2','c3','c4','c5','c6'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>c1</th>\n",
       "      <th>c2</th>\n",
       "      <th>c3</th>\n",
       "      <th>c4</th>\n",
       "      <th>c5</th>\n",
       "      <th>c6</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>0.649883</td>\n",
       "      <td>0.611234</td>\n",
       "      <td>0.147865</td>\n",
       "      <td>0.307980</td>\n",
       "      <td>0.674897</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.615217</td>\n",
       "      <td>0.627108</td>\n",
       "      <td>0.458184</td>\n",
       "      <td>0.495353</td>\n",
       "      <td>0.072155</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>D</th>\n",
       "      <td>0.741560</td>\n",
       "      <td>0.117488</td>\n",
       "      <td>0.897019</td>\n",
       "      <td>0.296116</td>\n",
       "      <td>0.558359</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>E</th>\n",
       "      <td>0.969148</td>\n",
       "      <td>0.218885</td>\n",
       "      <td>0.235853</td>\n",
       "      <td>0.164188</td>\n",
       "      <td>0.203482</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>F</th>\n",
       "      <td>0.173675</td>\n",
       "      <td>0.337967</td>\n",
       "      <td>0.788934</td>\n",
       "      <td>0.511270</td>\n",
       "      <td>0.256199</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         c1        c2        c3        c4        c5  c6\n",
       "A  0.649883  0.611234  0.147865  0.307980  0.674897 NaN\n",
       "B  0.615217  0.627108  0.458184  0.495353  0.072155 NaN\n",
       "C       NaN       NaN       NaN       NaN       NaN NaN\n",
       "D  0.741560  0.117488  0.897019  0.296116  0.558359 NaN\n",
       "E  0.969148  0.218885  0.235853  0.164188  0.203482 NaN\n",
       "F  0.173675  0.337967  0.788934  0.511270  0.256199 NaN"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.reindex(index=['A','B','C','D','E','F'],columns=['c1','c2','c3','c4','c5','c6'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    1\n",
       "B    2\n",
       "C    3\n",
       "D    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    1\n",
       "B    2\n",
       "dtype: int64"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1.reindex(index=['A','B'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>c1</th>\n",
       "      <th>c2</th>\n",
       "      <th>c3</th>\n",
       "      <th>c4</th>\n",
       "      <th>c5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>0.649883</td>\n",
       "      <td>0.611234</td>\n",
       "      <td>0.147865</td>\n",
       "      <td>0.307980</td>\n",
       "      <td>0.674897</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.615217</td>\n",
       "      <td>0.627108</td>\n",
       "      <td>0.458184</td>\n",
       "      <td>0.495353</td>\n",
       "      <td>0.072155</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>D</th>\n",
       "      <td>0.741560</td>\n",
       "      <td>0.117488</td>\n",
       "      <td>0.897019</td>\n",
       "      <td>0.296116</td>\n",
       "      <td>0.558359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>E</th>\n",
       "      <td>0.969148</td>\n",
       "      <td>0.218885</td>\n",
       "      <td>0.235853</td>\n",
       "      <td>0.164188</td>\n",
       "      <td>0.203482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>F</th>\n",
       "      <td>0.173675</td>\n",
       "      <td>0.337967</td>\n",
       "      <td>0.788934</td>\n",
       "      <td>0.511270</td>\n",
       "      <td>0.256199</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         c1        c2        c3        c4        c5\n",
       "A  0.649883  0.611234  0.147865  0.307980  0.674897\n",
       "B  0.615217  0.627108  0.458184  0.495353  0.072155\n",
       "D  0.741560  0.117488  0.897019  0.296116  0.558359\n",
       "E  0.969148  0.218885  0.235853  0.164188  0.203482\n",
       "F  0.173675  0.337967  0.788934  0.511270  0.256199"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>c1</th>\n",
       "      <th>c2</th>\n",
       "      <th>c3</th>\n",
       "      <th>c4</th>\n",
       "      <th>c5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>0.649883</td>\n",
       "      <td>0.611234</td>\n",
       "      <td>0.147865</td>\n",
       "      <td>0.307980</td>\n",
       "      <td>0.674897</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.615217</td>\n",
       "      <td>0.627108</td>\n",
       "      <td>0.458184</td>\n",
       "      <td>0.495353</td>\n",
       "      <td>0.072155</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         c1        c2        c3        c4        c5\n",
       "A  0.649883  0.611234  0.147865  0.307980  0.674897\n",
       "B  0.615217  0.627108  0.458184  0.495353  0.072155"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.reindex(index=['A','B'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Series and dataframe drop"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    1\n",
       "B    2\n",
       "C    3\n",
       "D    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "B    2\n",
       "C    3\n",
       "D    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1.drop('A')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>c1</th>\n",
       "      <th>c2</th>\n",
       "      <th>c3</th>\n",
       "      <th>c4</th>\n",
       "      <th>c5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>0.649883</td>\n",
       "      <td>0.611234</td>\n",
       "      <td>0.147865</td>\n",
       "      <td>0.307980</td>\n",
       "      <td>0.674897</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.615217</td>\n",
       "      <td>0.627108</td>\n",
       "      <td>0.458184</td>\n",
       "      <td>0.495353</td>\n",
       "      <td>0.072155</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>D</th>\n",
       "      <td>0.741560</td>\n",
       "      <td>0.117488</td>\n",
       "      <td>0.897019</td>\n",
       "      <td>0.296116</td>\n",
       "      <td>0.558359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>E</th>\n",
       "      <td>0.969148</td>\n",
       "      <td>0.218885</td>\n",
       "      <td>0.235853</td>\n",
       "      <td>0.164188</td>\n",
       "      <td>0.203482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>F</th>\n",
       "      <td>0.173675</td>\n",
       "      <td>0.337967</td>\n",
       "      <td>0.788934</td>\n",
       "      <td>0.511270</td>\n",
       "      <td>0.256199</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         c1        c2        c3        c4        c5\n",
       "A  0.649883  0.611234  0.147865  0.307980  0.674897\n",
       "B  0.615217  0.627108  0.458184  0.495353  0.072155\n",
       "D  0.741560  0.117488  0.897019  0.296116  0.558359\n",
       "E  0.969148  0.218885  0.235853  0.164188  0.203482\n",
       "F  0.173675  0.337967  0.788934  0.511270  0.256199"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>c2</th>\n",
       "      <th>c3</th>\n",
       "      <th>c4</th>\n",
       "      <th>c5</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>0.611234</td>\n",
       "      <td>0.147865</td>\n",
       "      <td>0.307980</td>\n",
       "      <td>0.674897</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.627108</td>\n",
       "      <td>0.458184</td>\n",
       "      <td>0.495353</td>\n",
       "      <td>0.072155</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>D</th>\n",
       "      <td>0.117488</td>\n",
       "      <td>0.897019</td>\n",
       "      <td>0.296116</td>\n",
       "      <td>0.558359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>E</th>\n",
       "      <td>0.218885</td>\n",
       "      <td>0.235853</td>\n",
       "      <td>0.164188</td>\n",
       "      <td>0.203482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>F</th>\n",
       "      <td>0.337967</td>\n",
       "      <td>0.788934</td>\n",
       "      <td>0.511270</td>\n",
       "      <td>0.256199</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         c2        c3        c4        c5\n",
       "A  0.611234  0.147865  0.307980  0.674897\n",
       "B  0.627108  0.458184  0.495353  0.072155\n",
       "D  0.117488  0.897019  0.296116  0.558359\n",
       "E  0.218885  0.235853  0.164188  0.203482\n",
       "F  0.337967  0.788934  0.511270  0.256199"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.drop('c1', axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
